Skip to content

Add multimodal vision support (mmproj) and image attachments#336

Merged
bernardladenthin merged 5 commits into
mainfrom
claude/java-llama-android-issues-1xkkjz
Jul 12, 2026
Merged

Add multimodal vision support (mmproj) and image attachments#336
bernardladenthin merged 5 commits into
mainfrom
claude/java-llama-android-issues-1xkkjz

Conversation

@bernardladenthin

Copy link
Copy Markdown
Owner

Summary

  • Vision projector (mmproj) support: Users can now optionally load a GGUF vision projector alongside the main model. The mmproj is picked via SAF, copied to transient app storage, and applied on the next model load. It can be set/cleared independently of the main model.
  • Image attachments: When a vision model is loaded, users can attach images (📎 button) to messages. Images are staged in memory and converted to multimodal ContentParts when sent, enabling vision-capable models like Gemma 3 4B to process images.
  • Multimodal message format: Message data class now carries optional imageBytes and imageMimeType fields. A new toChatMessage() converter builds wire-format ChatMessages with ContentPart.imageBytes() when images are present.
  • llama.cpp upgrade: Bumped from b9964 to b9972 to pick up multimodal inference improvements.
  • UI enhancements: Model picker shows vision projector selection with a ✕ button to clear. Conversation screen displays a removable chip for pending images and gates the attach button on vision model availability.
  • Localization: Added vision model strings across 13 languages (English, Arabic, German, Spanish, French, Hindi, Italian, Japanese, Korean, Portuguese, Russian, Turkish, Simplified Chinese).

Test plan

  • Existing unit/integration tests pass (no breaking changes to core inference flow)
  • CI is green on this branch
  • Manual verification: Load a text-only model → attach button hidden; load a vision model → attach button visible; attach an image → chip appears; send message → image is included in inference

Related issues / PRs

Implements multimodal vision support as outlined in R12 of requirements.md.

Checklist

  • I have read CONTRIBUTING.md and CODE_OF_CONDUCT.md
  • My commits follow Conventional Commits
  • No security-sensitive changes

https://claude.ai/code/session_01JMx6ZMVtGW7YoqWC3ha2dH

claude added 5 commits July 12, 2026 08:30
hasConversation (messages.isNotEmpty() || modelState == READY) stayed
true forever once a chat had any messages, so ChatScreen's state
selector never fell back to ChooseModelView after unloadModel() (or a
failed load) — even though ChatViewModel.unloadModel()'s own doc
comment (and requirement R3.8) says the UI should return to the
"no model loaded" state. The user was stuck on the Conversation screen
with only a plain text "Choose model" button in NotReadyBanner, no ❌
or back affordance anywhere.

Route on modelState == NONE first so the picker (with its ❌ quit
button) is always reachable once the model is unloaded, regardless of
leftover chat history; the history reappears once a model is READY
again.
Wires ModelParameters.setMmproj into the model-load path via a new
optional SAF picker on the model-picker screen (independent of the main
model, applied on next load), and adds a 📎 attach button in the chat
input (shown once a vision projector is loaded) that stages an image
via ContentPart.imageBytes for the next Send. Messages carrying an
image are built as multimodal ChatMessage turns instead of plain text.

Unloading the model also clears the vision projector and any pending
attachment (same privacy-wipe treatment as the model copy). Attached
images are session-transient — not persisted by SessionStore.

Updates requirements.md (new R12 section), TODO.md (flips the
attachment-button item to done), and README.md to match.
@bernardladenthin
bernardladenthin merged commit 03c9aa6 into main Jul 12, 2026
10 of 14 checks passed
@bernardladenthin
bernardladenthin deleted the claude/java-llama-android-issues-1xkkjz branch July 12, 2026 13:54
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants